﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>Sina</title>
</head>
<body>
    <div>@ViewBag.Result</div>
</body>
</html>
<script type="text/javascript">
    var verifierCode = "@ViewBag.Code", err = "", msg = "", url = "@ViewBag.ReturnUrl", nick = "@ViewBag.Nickname";

    if (url != "") {
        window.location.href = "http://i.emoney.cn/sinalogin.html?nick=" + escape(nick);
    }
    else {
        if (verifierCode == "") {
            err = "-1";
            msg = "获取临时授权code失败！";
        }
        else {
            err = "0";
            msg = "";
        }

        var data = "{\"err\": " + err + ",\"msg\": \"" + msg + "\",\"from\": " + 101 + ",\"code\": \"" + verifierCode + "\"}";
        
        try {
            window.external.OnCallLocalFunction("OnOAuthLogin", data);
        } catch (ex) {
        }
    }
</script>